package com.lh.lepay.controller;

import com.lh.lepay.entity.vo.BillingManagementVo;
import com.lh.lepay.service.BillingManagementService;
import com.lh.lepay.utils.ResponseData;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;


/**
 * (BillingManagement.)表控制层
 *
 * @author makejava
 * @since 2024-12-04 14:32:05
 */
@RestController
@Tag(name = "账单")
@RequestMapping("/bill")
public class BillingManagementController{
    @Resource
    private BillingManagementService billingManagementService;


    @GetMapping("/billingList/{currentPage}/{pageSize}")
    @Operation(description = "账单列表")
    //@PreAuthorize("hasAnyAuthority('sys:info:test')")TODO @PreAuthorize在控制层使用无效 在server层生效
    public ResponseData getBillingList(@PathVariable("currentPage") Integer currentPage,@PathVariable("pageSize") Integer pageSize,String queryString){
        ResponseData responseData = billingManagementService.getBillingListData(currentPage,pageSize,queryString);
        return responseData;
    }

    @GetMapping("/billingList")
    @Operation(description = "账单列表")
    public ResponseData getBillingList2(Integer currentPage,Integer pageSize,String queryString){
        ResponseData responseData = billingManagementService.getBillingListData(currentPage,pageSize,queryString);
        return responseData;
    }


    @PostMapping("/addBillingList")
    @Operation(description = "添加账单数据")
    public ResponseData addBillingList(@RequestBody BillingManagementVo billingManagementVo){
        ResponseData responseData = billingManagementService.addBillingListData(billingManagementVo);
        return responseData;
    }
}

